#include "PayOff.h"
#include <algorithm>

class VanillaCallPayOff : public PayOff
{
public:
	VanillaCallPayOff(double strike):m_strike(strike){}
	virtual ~VanillaCallPayOff(){};
public:
	virtual double operator()(double S_T) const {return std::max(S_T-m_strike,0.0);} 
	virtual VanillaCallPayOff* clone() const {return new VanillaCallPayOff(*this);};
private:
	double m_strike;
};

class VanillaPutPayOff : public PayOff
{
public:
	VanillaPutPayOff(double strike):m_strike(strike){}
	virtual ~VanillaPutPayOff(){};
public:
	virtual double operator()(double S_T) const {return std::max(m_strike-S_T,0.0);} 
	virtual VanillaPutPayOff* clone() const {return new VanillaPutPayOff(*this);}
private:
	double m_strike;
};